home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / MemAllocators.p < prev    next >
Text File  |  1996-05-01  |  3KB  |  100 lines

  1. {
  2.      File:        MemAllocators.p
  3.  
  4.      Version:    Technology:    
  5.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  6.  
  7.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16. {$IFC UNDEFINED UsingIncludes}
  17. {$SETC UsingIncludes := 0}
  18. {$ENDC}
  19.  
  20. {$IFC NOT UsingIncludes}
  21.  UNIT MemAllocators;
  22.  INTERFACE
  23. {$ENDC}
  24.  
  25. {$IFC UNDEFINED __MEMALLOCATORS__}
  26. {$SETC __MEMALLOCATORS__ := 1}
  27.  
  28. {$I+}
  29. {$SETC MemAllocatorsIncludes := UsingIncludes}
  30. {$SETC UsingIncludes := 1}
  31.  
  32. {$IFC UNDEFINED __TYPES__}
  33. {$I Types.p}
  34. {$ENDC}
  35. {$IFC UNDEFINED __MIXEDMODE__}
  36. {$I MixedMode.p}
  37. {$ENDC}
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  44. {
  45.  *    NOTE:  Callers of the MemAllocators API are gauranteed at least
  46.  *    kMemAllocatorAlignment_Minimum alignment of all allocated blocks.
  47. }
  48.  
  49. CONST
  50.     kMemAllocatorAlignment_Minimum = 2;                            {  (4 Byte Alignment Gaurantee)  }
  51.  
  52.  
  53. TYPE
  54.     MemAllocatorRef = ^LONGINT;
  55. {
  56.  *    Handle support
  57. }
  58. FUNCTION MemNewHandle(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outHandle: Handle): OSStatus; C;
  59. FUNCTION MemNewHandleClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outHandle: Handle): OSStatus; C;
  60. FUNCTION MemDisposeHandle(VAR ioHandle: Handle): OSStatus; C;
  61. FUNCTION MemSizeHandle(inSize: ByteCount; inHandle: Handle): OSStatus; C;
  62. FUNCTION MemGetHandleSize(inHandle: Handle; VAR outSize: ByteCount): OSStatus; C;
  63. {
  64.  * Fixed block support
  65. }
  66. FUNCTION MemNewFixed(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
  67. FUNCTION MemNewFixedClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
  68. {  inAlignment must be in the range 0..31  }
  69. FUNCTION MemNewFixedAligned(inAllocator: MemAllocatorRef; inSize: ByteCount; inAlignment: UInt32; VAR outMemory: UNIV Ptr): OSStatus; C;
  70. {  inAlignment must be in the range 0..31  }
  71. FUNCTION MemNewFixedAlignedClear(inAllocator: MemAllocatorRef; inSize: ByteCount; inAlignment: UInt32; VAR outMemory: UNIV Ptr): OSStatus; C;
  72. FUNCTION MemDisposeFixed(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR ioMemory: UNIV Ptr): OSStatus; C;
  73. {
  74.  * Convenience macros
  75. }
  76. {
  77.  * Variable block support
  78. }
  79. FUNCTION MemNewVariable(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
  80. FUNCTION MemNewVariableClear(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR outMemory: UNIV Ptr): OSStatus; C;
  81. FUNCTION MemDisposeVariable(inAllocator: MemAllocatorRef; VAR ioMemory: UNIV Ptr): OSStatus; C;
  82. FUNCTION MemGetVariableSize(inAllocator: MemAllocatorRef; inMemory: UNIV Ptr; VAR outSize: ByteCount): OSStatus; C;
  83. FUNCTION MemSizeVariable(inAllocator: MemAllocatorRef; inSize: ByteCount; VAR ioMemory: UNIV Ptr): OSStatus; C;
  84. {
  85.  *    Debugging Support
  86. }
  87. FUNCTION MemCheckAllocator(inAllocator: MemAllocatorRef): OSStatus; C;
  88. FUNCTION MemForceFailure(inAllocator: MemAllocatorRef; inForceFailure: OSStatus): OSStatus; C;
  89. {$ENDC}
  90. {$ALIGN RESET}
  91. {$POP}
  92.  
  93. {$SETC UsingIncludes := MemAllocatorsIncludes}
  94.  
  95. {$ENDC} {__MEMALLOCATORS__}
  96.  
  97. {$IFC NOT UsingIncludes}
  98.  END.
  99. {$ENDC}
  100.